home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mgr / vdimgr.zoo / contrib / etc / init.c next >
Encoding:
C/C++ Source or Header  |  1993-03-16  |  1.2 KB  |  55 lines

  1. /*
  2.  * this is not needed anymore. use an appropriate MINT.CNF instead
  3.  *
  4.  *   ++jrb
  5.  */
  6.  
  7. asm("
  8. #APP
  9. | minimal gnu startup file
  10.     .globl    __stksize
  11.     .globl    __start
  12.     .globl  _main
  13.  
  14.     .even
  15.     .text
  16. __start:
  17.     movl    a7@(4), a5        | Fetch base page pointer
  18.     movl    a5@(24), a1        | Fetch bss base
  19.     addl    a5@(28), a1        | + size of bss
  20. | Allocate stack, a1 points beyond vectors
  21.     addl    __stksize, a1        | Allocate _stksize_ bytes of stack
  22.     movl    a1, a7            | Set the initial stack.
  23. | Release unused memory to the system pool.
  24.     subl    a5, a1            | Compute size of retained memory
  25.     movl    a1, a7@-
  26.     movl    a5, a7@-        | Base of retained memory
  27.     clrw    a7@-            | Must be zero
  28.     movw    #0x4A, a7@-        | Mshrink opcode
  29.     trap    #1            | Gemdos
  30.     lea    a7@(12), a7        | Pop arguments
  31. | Call main(argc, argv, envp)
  32.     subl    a6, a6            | Zero frame pointer
  33.     jbsr    _main            | Call main line
  34. | Exit with return from main
  35.     clrw    a7@-            | Pterm0()
  36.     trap    #1");
  37.  
  38. #include <osbind.h>
  39.  
  40. char *env = "\
  41. HOME=d:/bin\0\
  42. SHELL=d:\\bin\\shell.prg\0\
  43. DEFAULT_FONT=d:/mgr/font/sail6x8r.fnt\0\
  44. MGRFONT=d:/mgr/font\0\
  45. MGRICON=d:/mgr/icon\0\
  46. ARGV=d:\\bin\\mgr.prg\0\
  47. \0\0\0";
  48. char tail[128];
  49. long _stksize = 128L;
  50. main()
  51. {
  52.     *tail = 0x7f;
  53.     Pexec(0, "d:\\bin\\mgr.prg", tail, env);
  54. }
  55.